#!/bin/bash
#
# name: delete_cleint_account.sh
# auth: doctype <https://t.me/ndiey>
# desc:
##
clear

if [ "${EUID}" -ne 0 ]; then
    echo "You need to run this script as root" && exit 1
fi

read -p "enter username: " UserName
egrep "^$UserName" /etc/passwd >/dev/null
[ $? -ne 0 ] && echo "Username not exist!" && exit 2
passwd -l $UserName
userdel -f $UserName

clear
echo
echo "========================== [ DELETE ACCOUNT ]"
echo " Successfully delete user account"
echo "---------------------------------------------"
echo "Copyright 2021 Cybertize, Allright Reserved."
echo "============================================="
echo
